package com.huangjue.backend.entity;

import lombok.Data;

import java.time.LocalDateTime;

@Data
public class KimiFiles {
    private Integer id;
    private String filePath;
    private String fileId;
    private Integer userId;
    private String homeworkId;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    private FileStatus status;

    // 文件状态枚举
    public enum FileStatus {
        ACTIVE,    // 活跃状态
        DELETED    // 已删除状态
    }

    // 便捷方法：创建新实例
    public static KimiFiles of(String filePath, String fileId,
                               Integer userId, String homeworkId) {
        KimiFiles file = new KimiFiles();
        file.setFilePath(filePath);
        file.setFileId(fileId);
        file.setUserId(userId);
        file.setHomeworkId(homeworkId);
        file.setStatus(FileStatus.ACTIVE);
        return file;
    }

    // 标记为已删除
    public void markAsDeleted() {
        this.status = FileStatus.DELETED;
    }
}